var app=getApp();
Page({
    data:{
        dataArray:[],
    },
    onReady:function(){
    // 生命周期函数--监听页面初次渲染完成
    wx.setNavigationBarTitle({
        title: '游戏',
    })
    },
    onLoad:function(){
        this.netForGameInfo()
    },
    // 游戏
    netForGameInfo:function(){
    var that = this;
    app.showHud()
    wx.request({
      url: 'http://lol.video.luckyamy.com/api/?cat=jieshuo&page=1&ap=lol&ver=1.3',
      data: {
      },
      header: {
      },
      success: function(res) {
        console.log("game=====success")
        console.log(res.data)
        that.setData({
          dataArray:res.data,
        })
      },
      fail: function (res) {
        console.log("failed")
      }
    })
  },
  clickButtonGame:function(e){
    console.log(e.currentTarget.dataset.index)
    var item = this.data.dataArray[e.currentTarget.dataset.index];
    wx.navigateTo({
       url: 'gameList/gameList?id='+item.id+'&title='+item.title
    })
  },

});